package com.example.controller;

import com.example.common.enums.ResponseCodeEnum;
import com.example.common.utils.ApiResult;
import com.example.dao.TWarningMapper;
import com.example.model.query.TWarningQuery;
import com.example.service.TWarningService;
import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;

/**
 * 告警上报记录表
 * @author zhangr
 * @Description Created on 2020-12-22
 */

@RestController
@Controller
@RequestMapping("tWarning")
@Api(value = "告警上报记录管理",tags={"告警上报记录管理接口"})
public class TWarningController {

    @Autowired
    private TWarningService warningService;

    @GetMapping("/page")
    public ApiResult<TWarningQuery> page(TWarningQuery query){
        try {
            return warningService.pageUserVoByQuery(query);
        }   catch (Exception e) {
            e.printStackTrace();
            return new ApiResult<>(ResponseCodeEnum.MALL_SERVICE_PAGE_AD_FALSE);
        }
    }
}

